<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html>
<html>
<head>
	<title>会员中心</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" type="text/css" media="screen" href="${ROOT_PATH }content/css/style.css?v=1.7">
	<script src="${ROOT_PATH }content/scripts/jquery-1.10.1.min.js"></script>
    <script src="${ROOT_PATH }content/scripts/jquery.form.js"></script>
    <script src="${ROOT_PATH }content/scripts/public.js"></script>
    <script src="${ROOT_PATH }content/scripts/artDialog/jquery.artDialog.js?skin=idialog"></script>
    <script src="${ROOT_PATH }content/scripts/artDialog/artDialog.iframeTools.js"></script>
    <script src="${ROOT_PATH }content/scripts/jquery.fancybox.pack.js"></script>
    <script src="${ROOT_PATH }content/scripts/lk.js"></script>
    <script src="${ROOT_PATH }content/scripts/custom-form-elements.min.js"></script>   
	
</head>
<body>
	<section class="headerBg"></section>
	<section class="xz_kahao">
	    <div class="logo"><img src="${ROOT_PATH }content/images/front/kahao_logo.jpg" width="178" height="30"></div>
	    <form action="${ROOT_PATH }UCenter//index/bandStaffInfo" name="bindform" id="bindform" method="post">
	        <input type="hidden" name="action" id="action" value="save" />
	        <div class="xz_form">
	            <div class="xz_form_div"><input name="realname" type="text" id="realname" placeholder="员工号" class="lktxt"></div>
	            <div class="xz_form_div"><input name="cardcode" type="text" id="cardcode" placeholder="身份证号" onkeyup="this.value = this.value.toUpperCase();" class="lktxt"></div>
	            <div class="xz_form_div"><input name="mobile" type="text" id="mobile" placeholder="手机号码" class="lktxt"></div>
	            <div class="btn_submit"><input name="submit" type="submit" id="binding" value="确定绑定"></div>
	        </div>
	    </form>
	    <div style="text-align: right;">
	    	<a href="${ROOT_PATH }UCenter/index/electronicCard" style="text-decoration: underline;font-size:12px;">没有会员卡</a>
	    </div>
	</section>
<script>
 $(function () {
                    $('#bindform').submit(function () {
                        var options = {
                            beforeSubmit: function () {
                                if (checkCard()) {
                                    return true;
                                } else {
                                    return false;
                                }
                            },
                            dataType: 'json',
                            success: function (txt) {
                                if (txt.isok) {
                                    location.href = '${ROOT_PATH }UCenter/scancode';
                                    return false;
                                } else {
                                    altTip(txt.data, 'error', function () {});
                                    return false;
                                }
                            }
                        };
                        $('#bindform').ajaxSubmit(options);
                        return false;
                    });
					
                });


                function checkCard() {
                    var realname = $("#realname");
                    if (realname.val() == "") {
                        altTip("请输入员工号！", 'error', function () {
                            realname.focus();
                        });
                        return false;
                    }
                    var cardcode = $("#cardcode");
                    if (cardcode.val() == "") {
                        altTip("请输入身份号！", 'error', function () {
                            cardcode.focus();
                        });
                        return false;
                    }
                    var isok = true;
                    
                    return isok;

                }

$(function(){
   $('img').css('max-width', '100%'); 
});
</script>

	
</body>
</html>